/**
 * Copyright (c) 2023 murenchao
 * taomu is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *       http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package cool.taomu.box.guice.util

import cool.taomu.box.guice.BinderRule
import cool.taomu.box.guice.ann.Binders
import cool.taomu.box.guice.entity.BindersEntity

class TaomuGuiceUitl {
	def static toBinders(Binders bs) {
		var entity = new BindersEntity();
		if (!bs.properties.nullOrEmpty) {
			entity.properties = bs.properties;
		}
		if (bs.installs !== null && bs.installs.size > 0) {
			entity.installs = bs.installs;
		}
		if (bs.value !== null && bs.value.size > 0) {
			entity.values = BinderRule.toBinderEntity(bs.value);
		}
		return entity
	}
}
